﻿using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;

namespace Himp.TaskScheduling.V1
{
    /// <summary>
    /// 
    /// </summary>
    [Area(TaskSchedulingRemoteServiceConsts.ModuleName)]
    [RemoteService(Name = TaskSchedulingRemoteServiceConsts.RemoteServiceName)]
    [Route("api/taskScheduling/cmDeviceControl")]
    [ApiVersion("1.0")]
    [ApiController]
    [ControllerName("cmDeviceControl")]
    public class CmDeviceControlController : TaskSchedulingController
    {
        private ICmDeviceControlService _cmDeviceControlService;

        public CmDeviceControlController(ICmDeviceControlService cmDeviceControlService)
        {
            _cmDeviceControlService = cmDeviceControlService;
        }

        [HttpPut]
        [Route("{id}")]
        public async Task<CmDeviceControlDto> PutAsync(int id, [FromBody] CmDeviceControlUpdateDto input)
        {
            return await _cmDeviceControlService.PutAsync(id,input);
        }

        [HttpGet]
        [Route("{id}")]
        public async Task<CmDeviceControlDto> GetAsync(int id)
        {
            return await _cmDeviceControlService.GetAsync(id);
        }
    }
}
